'''
Created on 05-08-2010

@author: polo
'''
'''
Demonstration of jumping.
Dave Briccetti, Young Programmers Podcast: http://young-programmers.blogspot.com/
'''

import pygame
import floor, wolf
from pygame.locals import *




pygame.init()
clock = pygame.time.Clock()
screen = pygame.display.set_mode((800, 468), 0)
pygame.display.set_caption('CityWolf')


bkg = pygame.image.load("bkg.jpg")
rect_bkg = bkg.get_rect()


man = pygame.image.load('wolf.png').convert_alpha()

floor = floor.Floor(screen)
wolf=wolf.Wolf((100, floor.floorY(100)), floor)



print 'starting loop'
loop = True
while loop:
	for event in pygame.event.get():
		if event.type == QUIT  or (event.type == KEYDOWN and event.key == K_ESCAPE):
			loop = False

	if wolf.lived:
		wolf.handle_animation()
		wolf.handle_event(event,floor)
	else:
		floor.stopAll()
	screen.blit(bkg, rect_bkg)
	floor.draw(screen)
	screen.blit(man, wolf.rect,wolf.area)
	pygame.display.flip()
	clock.tick(20)



